from tools import all_flow_ILAE_1415, all_flow_ILAE_1416, all_flow_ILAE_1417, all_flow_ILAE_1418, all_flow_ILAE_1419, \
    all_flow_ILAE_1420, all_flow_ILAE_1421, all_flow_ILAE_1424, all_flow_ILAE_1425, all_flow_ILAE_1426, \
    all_flow_ILAE_1427, all_flow_ILAE_1428, all_flow_ILAE_1429, all_flow_ILAE_1430, all_flow_ILAE_1431, \
    all_flow_ILAE_1432, all_flow_ILAE_1433
from global_parameter import ip, port, username, DB_NAME

channel_2v0_scene1 = [
    "1, 1, 1, 1, '1', 5, '1', 2, '2023-07-29 17:00:55', NULL, '', 15, '', '1', NULL, NULL, NULL",
    "2, 1, 2, 100, '100', 5, '1', 2, '2023-07-29 17:00:55', NULL, '', 15, '', '1', NULL, NULL, NULL"]

no_group_2v0 = [
    "1, 1, 5, 1",
    "1, 100, 5, 1"]

# 通用算法
algo_scene = [
    "4, '1', '1', '1,3', '0', '', '0', NULL, '2023-04-14 11:44:50', NULL, NULL, NULL, NULL, NULL, 7, 14, 7, 14, '0', '0', '1'"]

"""
330kV电压等级对应的字典键值(8)  330kV电压等级线路数  330kV电压等级同源标志(True  False)  330kV电压等级分列标志(True  False)  330kV电压等级停电标志(True  False) 
220kV电压等级对应的字典键值(5)  220kV电压等级线路数  220kV电压等级同源标志(True  False)  220kV电压等级分列标志(True  False)  220kV电压等级停电标志(True  False) 
110kV电压等级对应的字典键值(4)  110kV电压等级线路数  110kV电压等级同源标志(True  False)  110kV电压等级分列标志(True  False)  110kV电压等级停电标志(True  False) 
10kV 电压等级对应的字典键值(3)  10kV 电压等级线路数  10kV 电压等级同源标志(True  False)  10kV 电压等级分列标志(True  False)  10kV 电压等级停电标志(True  False) 
"""
v_arg_2v0_gao_bing = [8, 0, False, False, False,
                      5, 2, False, False, False,
                      4, 0, False, False, False,
                      3, 0, False, False, False]

# ILAE-1415 电压线路分裂运行_非翻转场景触发及恢复
all_flow_ILAE_1415(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1415", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1416 电压线路分裂运行_非翻转场景触发及修改电压等级恢复
all_flow_ILAE_1416(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1416", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1417 电压线路分列运行_翻转场景触发及删除线路恢复
all_flow_ILAE_1417(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1417", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1418 电压线路同源_非翻转场景触发及恢复
all_flow_ILAE_1418(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1418", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1419 电压线路同源_非翻转场景触发及修改电压等级恢复
all_flow_ILAE_1419(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1419", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1420 电压线路同源_翻转场景触发及删除线路恢复
all_flow_ILAE_1420(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1420", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1421 电压线路同源_上报条件遍历检查
all_flow_ILAE_1421(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1421", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-20, 80])

# ILAE-1424 接线错误-多通道相序不一致_相位调整触发及恢复
all_flow_ILAE_1424(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1424", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1425 接线错误-多通道相序不一致_相位调整触发及修改线路电压等级恢复
all_flow_ILAE_1425(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1425", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])
#
# ILAE-1426 接线错误-多通道相序不一致_相位调整触发及删除恢复
all_flow_ILAE_1426(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1426", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1427 接线错误-多通道相序不一致_耦合单通道逆相序
all_flow_ILAE_1427(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1427", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-20, 80])

# ILAE-1428 电压诊断优先级_数据重复高于线路停电
all_flow_ILAE_1428(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1428", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1429 电压诊断优先级_线路停电高于频率异常
all_flow_ILAE_1429(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1429", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1430 电压诊断优先级_数据重复高于线路停电
all_flow_ILAE_1430(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1430", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1431 电压诊断优先级_频率异常高于单通道逆相序
all_flow_ILAE_1431(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1431", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1432 电压诊断优先级_单通道逆相序高于线路同源
all_flow_ILAE_1432(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1432", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])

# ILAE-1433 电压诊断优先级_多通道相序不一致高于分列运行
all_flow_ILAE_1433(ip, DB_NAME, v_arg_2v0_gao_bing, "ILAE-1433", channel_2v0_scene1,
                   no_group_2v0, algo_scene, [150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150, 150],
                   time_data=[-25, 70])
